cmake_minimum_required(VERSION 3.0)
project(amov_rtsp)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE "Debug")


find_package(OpenCV REQUIRED)
find_package(fmt REQUIRED)
find_package (yaml-cpp REQUIRED)


set(ffmpeg_lib 
    libavutil.so 
    libavcodec.so 
    libavformat.so 
    libavdevice.so 
    libavfilter.so 
    libswscale.so 
)


file(GLOB cpp_srcs "src/*.cpp" "src/*.hpp")

include_directories(
  "include"
)



add_executable(rtsp_pusher_demo rtsp_pusher_demo.cpp ${cpp_srcs})
target_link_libraries(
    rtsp_pusher_demo 
    ${OpenCV_LIBS} 
    ${ffmpeg_lib} 
    fmt
    yaml-cpp
    pthread

)

add_executable(rtsp_pusher_cam rtsp_pusher_cam.cpp ${cpp_srcs})
target_link_libraries(
    rtsp_pusher_cam 
    ${OpenCV_LIBS} 
    ${ffmpeg_lib} 
    fmt
    yaml-cpp
    pthread

)


add_executable(rtsp_puller_demo rtsp_puller_demo.cpp ${cpp_srcs})
target_link_libraries(
    rtsp_puller_demo 
    ${OpenCV_LIBS} 
    ${ffmpeg_lib} 
    fmt
    yaml-cpp
    pthread

)

add_executable(loacl_saver_demo loacl_saver_demo.cpp ${cpp_srcs})
target_link_libraries(
    loacl_saver_demo 
    ${OpenCV_LIBS} 
    ${ffmpeg_lib} 
    fmt
    yaml-cpp
    pthread
)

add_executable(loacl_saver_multi loacl_saver_multi.cpp ${cpp_srcs})
target_link_libraries(
    loacl_saver_multi 
    ${OpenCV_LIBS} 
    ${ffmpeg_lib} 
    fmt
    yaml-cpp
    pthread
)



